<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="perm" uri="/WEB-INF/tld/perm.tld"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<script>
	var ctx = "${ctx}";
</script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>我的地址</title>
<meta name="description" content="">
<meta name="keywords" content="">
<!-- 基础样式 -->
<link href="${ctx}/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">    
<link href="${ctx}/static/css/font-awesome.min.css?v=1" rel="stylesheet">	
<link href="${ctx}/static/css/iconfont.css?v=4" rel="stylesheet">
<link href="${ctx}/static/css/animate.min.css" rel="stylesheet">
<!-- Data Tables --> 
<link href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">	
<link href="${ctx}/static/css/style.min.css" rel="stylesheet">	
<link href="${ctx}/static/css/common.css" rel="stylesheet" />
<link href="${ctx}/static/js/region/css/city-picker.css" rel="stylesheet" type="text/css" />
</head>
<body class="gray-bg">	
	<div class="wrapper wrapper-content  animated fadeInRight">

   		<div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    
                    <!-- 地址列表 -->
                    <div class="ibox-title">
                        <h5>我的地址 <small></small></h5>         
                    </div>
                    <div class="ibox-content">
                        <table class="table table-striped table-bordered table-hover dataTables-example">    
                            <tbody>
								<c:forEach items="${address_list}" var="addr">
									 <tr class="gradeX">
										
										<td class="addr-name-phone fl">	<b>${addr.name}</b> &nbsp;${addr.phone} &nbsp;</td>
										<td class="addr-default">
										<c:choose>
											<c:when test="${addr.enable==1}">
											<a href="javascript:void(0);" class="default">&nbsp;默认地址&nbsp;</a> 
											</c:when>
											<c:otherwise>
												<a
													href="${ctx}/updateSate_address?addressId=${addr.id}">设置为默认</a>
											</c:otherwise>
										</c:choose>
										</td>
										
										<td>所在地区 ：${addr.city} ${addr.county}</td>
										<td>详情地址 ：${addr.address}</td>
										<td class="center">
											<b><a href="javascript:void(0);"
												onclick="loadAddressInfo(${addr.id})">编辑</a> | <a
												href="${ctx}/del_address?addressId=${addr.id}">删除</a></b>
										</td>
									</tr>
								</c:forEach>                            
                              <!--   <tr class="gradeX">
                                    <td>TXT</td>
                                    <td>Internet Explorer 4.0
                                    </td>
                                    <td>Win 95+</td>
                                    <td class="center">4</td>
                                    <td class="center">X</td>
                                </tr> -->
                            </tbody>
                        </table>
                    </div>
                    <!-- /地址列表 -->
                
                	<!-- 新增收货地址 -->
                     <div class="ibox-title">
                        <h5>新增收货地址 <small></small></h5>
                    </div>
                     <div class="ibox-content">
                        <form action="${ctx}/address-insert-update" method="post" class="form-horizontal">
                        	
                        	<input type="hidden" value="" name="addressid" id="addressid">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">收货人</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="name" id="name" value="" placeholder=" 请输入收货人" >
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">地址</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="city" id="city" value="" placeholder=" 请输入地址" readonly name="regioninfo" type="text" value="//" data-toggle="city-picker" >
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">详细地址</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="address" id="address" placeholder="请输入详细地址" >
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">邮编</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="zipcode" id="zipcode" value="" placeholder=" 请输入邮编" >
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div> 
                            <div class="form-group">
                                <label class="col-sm-2 control-label">手机号</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" id="mobile" name="phone" id="phone" value=""  placeholder=" 请输入手机号"  >
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>                                                         
					
                            <div class="form-group">
                                <label class="col-sm-2 control-label">邮箱</label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" id="email1" name="email" value="" placeholder=" 有效的邮箱地址"  >
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>  
                                
                            <div class="form-group">
                                <label class="col-sm-2 control-label"></label>
                                <div class="col-sm-5">                            
                            		<div class="checkbox">
                                        <label> <input type="checkbox" checked="checked" value="1" name="enable" id="enable">设为默认地址</label>
                                    </div>
                                 </div>
                             </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" onclick="return saveadress()" type="submit">保存收货地址</button>
                                    <button class="btn btn-white">取消</button>
                                </div>
                            </div>     					
				                            
                          </form>
                      </div>
                      <!-- /ibox-content -->
                      
                 </div>
              </div>
          </div>
        		

	</div>


	<!--:end-->
	<script src="${ctx}/static/js/jquery.min.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js"></script>
     <script src="${ctx}/static/js/region/js/city-picker.data.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/region/js/city-picker.js?v=${static_version}"></script>
  	<script src="${ctx}/static/js/member.address.js"></script>	
</body>
</html>